/* 响应式 */
/* 当屏幕小于1380px时 */
@media (max-width: 1380px) {

    /* 医案 */
    #yiAn .card {

        grid-template-columns: 1fr 6fr 1fr;

    }
}

/* 当屏幕小于1288px时 */
@media (max-width: 1288px) {

    /* 医案 */
    #yiAn .card {

        grid-template-columns: 1.3fr 6fr 1.2fr;

    }
}

/* 当屏幕小于1100px时 */
@media (max-width: 1100px) {

    /* 医案 */
    #yiAn .card {

        grid-template-columns: 1.6fr 6fr 1.5fr;

    }
}

/* 响应式 小于992px时 */
@media (max-width: 992px) {
    body {
        font-size: 18px;
    }

    header {
        padding: 0 30px;
        grid-template-columns: 1fr 4fr;
    }

    header .websiteName {
        font-size: 20px;
    }

    header nav a {
        padding: unset;
        margin: 0 7px;
    }

    main {
        margin: 0 30px;
    }

    .container {
        padding: unset;
    }

    /* 医案 */
    #yiAn .card {
        grid-template-columns: 2.3fr 6fr 1.9fr;
    }
}

/* 响应式 小于768px时 */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    header {
        padding: 0 10px;
        grid-template-columns: 1fr 4fr;
    }

    header .header-container {

        justify-content: space-between;
        color: var(--text-color-lightest);
    }


    header .websiteName {
        font-size: 18px;
    }

    header nav a {
        padding: unset;
        margin: 0 7px;
    }

    header nav {
        display: none;
        height: unset;
    }

    header .burger {
        display: block;
        width: 20px;
        height: 6px;
        position: relative;
        /* 右边 */
        justify-self: end;
        user-select: none;

    }

    header .burger:hover {
        /* 小手样式 */
        cursor: pointer;
    }

    .burger-line1,
    .burger-line2,
    .burger-line3 {
        width: 20px;
        height: 2px;
        background-color: var(--text-color-lightest);
    }

    .burger-line1 {
        position: absolute;
        top: -6px;
    }

    .burger-line3 {
        position: absolute;
        top: 6px;
    }



    /* 点击时给header加一个open类 */
    header .header-container.open {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 30vh;
        background-color: #fff;
        z-index: 3;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr 3fr;
        grid-template-areas:
            "logo websiteName burger"
            "nav nav nav";
        padding: 20px;
        /* 阴影 */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        animation: slideDown 0.6s ease-out forwards;
        overflow: hidden;
    }

    .header-container.open nav {
        display: flex;
        justify-content: space-between;
        width: 100%;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        margin-top: 10px;

    }

    .header-container.open nav>* {
        opacity: 0;
        animation: showMenu 0.5s linear forwards 0.8s;

    }

    .header-container.open nav a,
    .header-container.open .websiteName {
        color: #000;
    }

    .header-container.open nav a {
        padding: 10px 0;
    }

    .header-container.open nav .search-container {
        height: 70%;
    }

    .header-container.open nav .search-container #searchInp {
        padding: 8px;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .header-container.open .burger-line1,
    .header-container.open .burger-line2,
    .header-container.open .burger-line3 {
        background-color: #000;
        transition: all 0.3s ease-in-out;
    }

    .header-container.open .burger-line1 {
        transform: rotate(45deg) translate(2px, 3px);
    }

    .header-container.open .burger-line2 {
        transform: translateX(5px);
        opacity: 0;
    }

    .header-container.open .burger-line3 {
        transform: rotate(-45deg) translate(5px, -7px);
    }

    /* 导航下拉 动画 */
    @keyframes slideDown {
        from {
            height: 8vh;
            /* opacity: 0; */
        }

        to {
            height: 30vh;
            /* opacity: 1; */
        }

    }

    /* 显示菜单的动动画 */
    @keyframes showMenu {
        from {
            opacity: 0;
            transform: translateY(-1vh);
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }

    }

    main {
        position: relative;
        margin: 0 10px;
    }

    /* 小于768px时只显示1列 */
    main .tiaoWenBox {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr;
    }

    /* 小于768px时只显示1列,搜索页 */
    main .search-tiaowen-box {
        grid-template-columns: 1fr !important;
        grid-template-areas: "search-right-container  search-left-container" !important;
    }

    main .search-tiaowen-box .search-left-container {
        position: absolute;
        top: 0;
        /* 右边 */
        right: -100%;
        z-index: -1;

    }

    main .search-tiaowen-box .search-left-container.active {
        position: absolute;
        top: 0;
        /* 右边 */
        right: 0;
        z-index: 1;
        width: 30vw;
        height: 100%;
        background-color: #fff;
        border: unset;
        /* 阴影 */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        /* 去掉横向滚动条 */
        overflow-x: hidden;
    }

    /* 显示控制left-container 显示/隐藏的按钮 */
    main .display-hide-left-container,
    main {
        display: block;
    }

    /* 项目列表（伤寒/金匮） */
    main .tiaoWenBox .left-container.active {
        position: absolute;
        top: 0;
        /* 右边 */
        right: 0;
        z-index: 1;
        width: 35vw;
        height: 100%;
        background-color: #fff;
        border: unset;
        /* 阴影 */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        font-size: 14px;
    }

    .container {
        padding: unset;
    }

    /* 方剂弹窗 */
    .popup .popup-content {
        padding: 10px;
        width: 90vw;
        height: 70%;
    }
}

/* 小于576px时 */
@media (max-width: 576px) {
    .header-container.open nav {
        flex-wrap: wrap;
    }

    .header-container.open nav .search-container {
        width: 100%;
        margin-top: 10px;
    }

    .header-container.open nav .search-container #searchInp {
        width: 100%;
    }

    /* 方剂弹窗      */
    .popup {
        z-index: 3;
    }

    .popup .popup-content {
        padding: 10px;
        width: 90vw;
        height: 94%;
    }


    .popup .popup-title-name {
        font-size: 25px;
    }

    #tiaoWenJieShi-popup .popup-main {
        height: calc(82%);
    }

    main .display-hide-left-container .display-hide-left-container-box {
        font-size: 1em;
    }

    /* 项目列表（伤寒/金匮） */
    main .tiaoWenBox .left-container.active {
        font-size: 10px;
    }

    /* 显示控制left-container 显示/隐藏的按钮 */
    main .display-hide-left-container {
        width: 10vw;
        height: 10vw;
    }
}